package Bk.basic;

import java.util.Scanner;

public class J06_Expression39 {

	public static void main(String[] args) {

		Scanner input = null;
		input = new Scanner(System.in);
		
		int sum = 0;
		int number = input.nextInt();
		
		do {
			sum += number;
			number = input.nextInt();
		} while ( number != 0 );
		
		
		
		
		
	}

}
